app.controller('tests',function($scope,$http,$ionicLoading,$ionicScrollDelegate){
	$ionicLoading.show()
	$scope.scrollTop = function() {
    $ionicScrollDelegate.scrollTop();
  };
	$http.get('/api/v2/articles',{
		params:{
			"type":"report",
			"offset":0,
			"limit":12
		}
	}).then(function(res){
		if(res){
			$ionicLoading.hide()
		}
		console.log(res.data)
		$scope.runing=res.data
		$scope.shows()
		$scope.loadMore=function(){
			$scope.shows()
		}
		$scope.loads=function(){
			$scope.loadMore()
		}
	}).catch(function(err){
		$ionicLoading.show({
			duration:3000,
			template:'获取失败'
		})
	})
	$scope.shows=function(){
		$http.get('/api/v2/articles',{
		params:{
			"type":"report",
			"offset":$scope.runing.length,
			"limit":12
		}
	}).then(function(res){
		if(res){
			$ionicLoading.hide()
		}
		console.log(res.data)
		$scope.runing=$scope.runing.concat(res.data)
	}).catch(function(err){
		$ionicLoading.show({
			duration:3000,
			template:'获取失败'
		})
	})
	}
	Window.onScroll=function(){
		console.log('aaaa')
	}
})
